package com.xiaohudie.controller;

import com.xiaohudie.annotation.LogBiaoZhi;
import com.xiaohudie.pojo.AjaxResult;
import com.xiaohudie.servier.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author xiao hu die
 * @Date 2022/4/6 10:51
 * @Version 1.0
 */
@RestController
@RequestMapping("/test")
@Slf4j
public class TestController {
 @Autowired
    private TestService testService;
 @GetMapping("/select")
 @LogBiaoZhi
    public AjaxResult select(){
     String s = testService.testSelect();
     System.out.println(s);
    return AjaxResult.success(s);
 }
 @GetMapping("/update")
 @LogBiaoZhi
    public void update(){
     testService.testUpdate();
 }
 @GetMapping("/hanshu")
 @LogBiaoZhi
    public AjaxResult cunchuguocheng(@RequestParam("param") Integer param){
     Integer integer = testService.proTest8(param);
     log.info("传递的参数为:"+param);
     return AjaxResult.success(integer);
 }
}
